package com.xinqi.modules.prepare.prepare.enums;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.xinqi.common.base.annotations.Describe;
import com.xinqi.common.base.enums.BaseEnum;
import lombok.Getter;

/**
 * 备课区操作类型
 * <p>
 * 操作类型：FILE_EDIT-文件编辑；FILE_DEL-文件删除；MEMBER_CHANGE-成员变动；QUESTION_EDIT-编辑试题，QUESTION_DEL-删除试题
 * </p>
 *
 * @author linkai
 * @date 2023/03/19
 */
@Describe("备课区操作类型")
public enum PrepareOperateTypeEnum implements BaseEnum {

    FILE_EDIT("FILE_EDIT", "文件编辑"),
    FILE_DEL("FILE_DEL", "文件删除"),
    MEMBER_CHANGE("MEMBER_CHANGE", "成员变动"),
    QUESTION_EDIT("QUESTION_EDIT", "编辑试题"),
    QUESTION_DEL("QUESTION_DEL", "删除试题"),
    ;

    @Getter(onMethod_ = {@JsonValue})
    private final String code;

    @Getter
    private final String describe;

    PrepareOperateTypeEnum(String code, String describe) {
        this.code = code;
        this.describe = describe;
    }

    @JsonCreator
    public static PrepareOperateTypeEnum of(String code) {
        return BaseEnum.of(PrepareOperateTypeEnum.class, code);
    }

}
